05-04 things-to-change-and-check
things to change and check​
This section will focus on the common properties that are checked and changed with these types of manipulations.
properties of the Range
​
The common properties of the Range
to work with include:
Value
Text
Formula
Font
Interior
NumberFormat
TODO: add some examples of working with these
commonly used VBA functions​
In addition to the properties of the Range
, there are a handful of common VBA functions that come up when working with simple to moderate manipulations. These include:
Split
- split a string into an array based on a delimiter (the reverse of Join)Join
- join an array into a string with a delimiter (this reverse of Split)Asc
- determine the ASCII code for a characterChr
- return a character for an ASCII code (the reverse of Asc)InStr
- determine if a string is in another one (called Substring in other languages)Left
, Mid, Right - grab parts of a stringTrim
- remove any whitespace from the start or end of a stringLen
- determine the length of a stringUCase
, LCase - used to force a string to upper or lower caseUBound
, LBound - determine the bounds of any arrayWorksheetFunction
- get access to any Excel functions in VBAIsNumeric
, IsEmpty - check if a number -- TODO: add the others hereCDbl
, CLng, CBool, CDate - convert a value of one type to another -- TODO: add any othersReplace
- replace one string in anotherApplication
.Index, Application.Match - these are the VBA versions of the Excel functionsApplication
.Transpose - convert a 1D array from vertical to horizontal and backIs
Nothing - check if a reference has been setTypeName
- check the type of an object (useful if working withVariant
)RGB
- useful way to build colors from known red, green, and blue valuesCount
- common way to get the size of a group, used often to resize an input/output or to check logic
TODO: search through bUTL for other common functions